#pragma once

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/fcntl.h>
#include <sys/un.h>  
#include <stddef.h>
#include <sys/socket.h>
#include <string>
#include <iostream>
#include <thread>

#include "message.h"

class ubus_client{

private:
	struct  sockaddr_un client_un;
	struct  sockaddr_un server_un;
	message_ message;
	int client_fd;
	
public:
	ubus_client(const char *client_path, const char  *server_path);
	~ubus_client();
	void init_client(const char *client_path, const char  *server_path);

	void set_message_head(char *info);
	void sendmessage();
	bool set_read_head(char *sendinfo, int *sendinfo_size);
};
